package com.ruoyi.system.mysql.mongodb;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

@Document(collection = "users")  // 对应集合名
@Data
public class User {
    @Id
    private String id;

    @Field("name")
    private String name;

    @Field("age")
    private Integer age;

    private String email;

    // 构造函数
    public User() {}

    public User(String name, Integer age, String email) {
        this.name = name;
        this.age = age;
        this.email = email;
    }

    // getter 和 setter...
}
